import { ApiProperty } from '@nestjs/swagger';

/**
 * Pagination metadata DTO
 * Common DTO for pagination metadata across all modules
 */
export class PaginationMetaDto {
  @ApiProperty({
    description: '总记录数',
    example: 100,
  })
  total: number;

  @ApiProperty({
    description: '当前页码',
    example: 1,
  })
  page: number;

  @ApiProperty({
    description: '每页数量',
    example: 10,
  })
  pageSize: number;
}

/**
 * Paginated response DTO
 * Generic paginated response that can be used across all modules
 */
export class PaginatedResponseDto<T> {
  @ApiProperty({
    description: '数据列表',
    isArray: true,
  })
  data: T[];

  @ApiProperty({
    description: '分页元数据',
    type: PaginationMetaDto,
  })
  pagination: PaginationMetaDto;
}
